This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mickael-menu
commented
Apr 28, 2020
@@ -118,7 +118,7 @@ final class CBCDRMInputStream: DRMInputStream { | |||
} | |||
|
|||
// TODO: Double check if there is a different way to remove padding from HTML resources only. | |||
if (link.type == "application/xhtml+xml") { | |||
if link.mediaType?.isHTML == true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also match text/html
now.
mickael-menu
commented
Apr 28, 2020
public static let mimetype = "application/vnd.comicbook+zip" | ||
} | ||
|
||
public enum MediaType: String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By replacing this with Format.of()
and checking format.mediaType.isBitmap
, we are supporting much more formats in a CBZ.
mickael-menu
commented
Apr 28, 2020
@@ -60,15 +56,17 @@ public final class PDFParser: PublicationParser, Loggable { | |||
/// - Returns: The Resulting publication, and a callback for parsing the possibly DRM encrypted metadata in the publication, once the DRM object is filled by a DRM module (eg. LCP). | |||
/// - Throws: `PDFParserError` | |||
public static func parse(at url: URL, parserType: PDFFileParser.Type) throws -> (PubBox, PubParsingCallback) { | |||
guard FileManager.default.fileExists(atPath: url.path) else { | |||
guard FileManager.default.fileExists(atPath: url.path), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we can open a PDF even if it doesn't have a file extension.
mickael-menu
force-pushed
the
feature/format-api
branch
from
April 29, 2020 14:00
ea6b3a9
to
6a1008e
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See readium/r2-shared-swift#88